/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
var url="/lcfgly";
$("#formpost").click(function(){
                var oldpassword=$("[name=oldpassword]").val();
                var newpassword=$("[name=newpassword]").val();
                var newpasswordagain=$("[name=newpasswordagain]").val();
                $.post(url+"/control/passwordchange.html" ,{oldpassword:oldpassword,newpassword:newpassword,newpasswordagain:newpasswordagain},
                        function(data){
                            if(data.success){
                                $("#leftsuccessinfo").html(data.msg);
                                $("#showsuccess").click();
                        }else{
                            $("#lefterrorinfo").empty();
                            for(var x in data.error)
                                $("#lefterrorinfo").append(data.error[x]+"<br />");
                            $("#showerrorleft").click();
                        }
    },"json");
            });
            $("#userinferpost").click(function(){
                var cssstyle=$("#simpleuserinfer  #cssstyle").val();
                var phone=$("#simpleuserinfer  #phone").val();
                var email=$("#simpleuserinfer #email").val();
                var tel=$("#simpleuserinfer #tel").val();
                $.post(url+"/control/simpleuserinfer.html" ,{
                    cssstyle:cssstyle,
                    phone:phone,
                    email:email,
                    tel:tel
                },function(data){
                            if(data.success){
                                $("#leftsuccessinfo").html(data.msg);
                                $("#showsuccess").click();
                        }else{
                            $("#lefterrorinfo").empty();
                            for(var x in data.error)
                                $("#lefterrorinfo").append(data.error[x]+"<br />");
                            $("#showerrorleft").click();
                        }
    },"json")
            });

function getLocalTime(nS) {
    return new Date(parseInt(nS)).toLocaleString().replace(/:\d{1,2}$/, ' ');
}